package com.company;

public class Test27数组逆序 {
    public static void main(String[] args) {
        nixu();
    }

    /**
     * 数组逆序
     */
    public  static void nixu(){
        int num[]={1,2,3,4,5,6};
        for(int i=0,j=num.length-1;i<j;i++,j--){
            int tmp=num[j];
            num[j]=num[i];
            num[i]=tmp;
        }
        for(int i=0;i<num.length;i++){
            System.out.println(num[i]);
        }
    }
}
